<html><head><title>Programming Examples for Controls in the Dialog Editor</title><meta name="filename" content="text/sbasic/guide/sample_code"/><help:css-file-link xmlns:help="http://openoffice.org/2000/help"/><!--The CSS style header method for setting styles--><style type="text/css">
table.Tabelle1{
}
span.Tabelle1A{
width:0.979cm;}
span.Tabelle1B{
width:17.02cm;}
td.Tabelle1A1{
}
p.P1{
}
span.T1{
font-weight:bold;}
span.fr1{
}
</style></head><body>
<p class="P1"/>
<p class="Head1"><help:paragraphinfo state="U" number="1" xmlns:help="http://openoffice.org/2000/help"/><help:key-word value="programming examples; controls in dialog editor" tag="kw68535_1" xmlns:help="http://openoffice.org/2000/help"/><help:to-be-embedded Eid="sample_code" xmlns:help="http://openoffice.org/2000/help"><help:link Id="68535">Programming Examples for Controls in the Dialog Editor</help:link></help:to-be-embedded></p>
<p class="Paragraph"><help:paragraphinfo state="U" number="2" xmlns:help="http://openoffice.org/2000/help"/>The following examples are for a new <help:link Id="68530" xmlns:help="http://openoffice.org/2000/help">dialog</help:link> called "Dialog1". Use the tools on the <span class="T1">Control </span>floating toolbar in the dialog editor to create the dialog and add the following controls: a <span class="T1">Check Box</span> called "CheckBox1", a <span class="T1">Label Field</span> called "Label1", a <span class="T1">Button</span> called "CommandButton1", and a <span class="T1">List Box</span> called "ListBox1".</p>
<p class="TextInTable"><draw:image draw:name="Icon0" svg:desc="This icon marks text containing important information on data and system security." svg:pixelx="32" svg:pixely="32" svg:width="0.847cm" svg:height="0.847cm" xlink:href="65640" draw:filter-name="" xmlns:draw="http://openoffice.org/2000/drawing" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"/></p>
<p class="TextInTable"><help:paragraphinfo state="U" number="3" xmlns:help="http://openoffice.org/2000/help"/>Be consistent with uppercase and lowercase letter when you attach a control to an object variable.</p>
</span></th></tr></table>
<p class="Head3"><help:paragraphinfo state="U" number="4" xmlns:help="http://openoffice.org/2000/help"/><a name="dialogload"/><help:key-word value="examples; loading a dialog" tag="kw68535_6" xmlns:help="http://openoffice.org/2000/help"/>Global Function for Loading Dialogs</p>
<p class="PropText"><help:paragraphinfo state="U" number="73" xmlns:help="http://openoffice.org/2000/help"/>Function LoadDialog(Libname as String, DialogName as String, Optional oLibContainer)</p>
<p class="PropText"><help:paragraphinfo state="U" number="74" xmlns:help="http://openoffice.org/2000/help"/>Dim oLib as Object</p>
<p class="PropText"><help:paragraphinfo state="U" number="75" xmlns:help="http://openoffice.org/2000/help"/>Dim oLibDialog as Object</p>
<p class="PropText"><help:paragraphinfo state="U" number="76" xmlns:help="http://openoffice.org/2000/help"/>Dim oRuntimeDialog as Object</p>
<p class="Head3"><help:paragraphinfo state="U" number="27" xmlns:help="http://openoffice.org/2000/help"/><help:key-word value="examples; read or edit properties of controls" tag="kw68535_4" xmlns:help="http://openoffice.org/2000/help"/>Read or Edit Properties of Controls in the Program</p>
<p class="PropText"><help:paragraphinfo state="U" number="143" xmlns:help="http://openoffice.org/2000/help"/>REM set new text for control Label1</p>
<p class="PropText"><help:paragraphinfo state="U" number="144" xmlns:help="http://openoffice.org/2000/help"/>oLabel1.Text = "New Files"</p>
<p class="PropText"><help:paragraphinfo state="U" number="145" xmlns:help="http://openoffice.org/2000/help"/>REM display model properties for the control CheckBox1</p>
<p class="PropText"><help:paragraphinfo state="U" number="148" xmlns:help="http://openoffice.org/2000/help"/>REM set new state for CheckBox1 for model of control</p>
<p class="PropText"><help:paragraphinfo state="U" number="150" xmlns:help="http://openoffice.org/2000/help"/>REM display model properties for control CommandButton1</p>
<p class="PropText"><help:paragraphinfo state="U" number="153" xmlns:help="http://openoffice.org/2000/help"/>REM display properties of control CommandButton1</p>
<p class="Head3"><help:paragraphinfo state="U" number="55" xmlns:help="http://openoffice.org/2000/help"/><help:key-word value="examples; adding entry to ListBox" tag="kw68535_3" xmlns:help="http://openoffice.org/2000/help"/>Add an Entry to a ListBox</p>
<p class="Head3"><help:paragraphinfo state="U" number="64" xmlns:help="http://openoffice.org/2000/help"/><help:key-word value="examples; remove entry from ListBox" tag="kw68535_2" xmlns:help="http://openoffice.org/2000/help"/>Remove an Entry from a ListBox</p>
<p class="PropText"><help:paragraphinfo state="U" number="131" xmlns:help="http://openoffice.org/2000/help"/>REM remove the first entry from the ListBox</p>